<template>
    <div class="user">
        <div class="custom-head">
            <div class="top">
                <img @click="toHome" class="logo" src="../../assets/logo.png" alt="">
                <div class="right">
                    <div class="search">
                        <div class="left">
                            <img src="../../assets/search-icon.png" alt="">
                            <el-input placeholder="搜索"></el-input>
                        </div>
                        <el-button class="search-btn">检索中心</el-button>
                        <el-button class="question-btn" type="text">问答中心</el-button>
                    </div>
                    <div class="icon">
                        <span class="skin-icon">
                            <img src="../../assets/skin-icon.png" alt="">
                        </span>
                        <span>
                            <img src="../../assets/my-icon.png" alt="">
                        </span>
                        <span @click="sidebarDialog = true">
                            <img src="../../assets/expansion-fold-icon.png" alt="">
                        </span>
                    </div>
                </div>
            </div>
        </div>
        <div class="content">
            <div class="left">
                <el-col :span="12">
                    <el-menu router default-active="user-profile" class="el-menu-vertical-demo" 
                         background-color="#2F4050" text-color="#fff" active-text-color="#ffd04b">
                        <el-menu-item index="user-profile">
                            <i class="el-icon-user-solid"></i>
                            <span slot="title">个人资料</span>
                        </el-menu-item>
                        <!-- <el-menu-item index="editPass">
                            <i class="el-icon-edit-outline"></i>
                            <span slot="title">修改密码</span>
                        </el-menu-item> -->
                        <el-menu-item index="operationLog">
                            <i class="el-icon-thumb"></i>
                            <span slot="title">操作日志</span>
                        </el-menu-item>
                        <el-menu-item index="myFavorite">
                            <i class="el-icon-collection-tag"></i>
                            <span slot="title">我的收藏</span>
                        </el-menu-item>
                    </el-menu>
                </el-col>
            </div>
            <div class="right">
                <el-breadcrumb separator-class="el-icon-arrow-right">
                    <el-breadcrumb-item :to="{ path: '/' }">用户中心</el-breadcrumb-item>
                    <el-breadcrumb-item>{{$route.meta.title}}</el-breadcrumb-item>
                </el-breadcrumb>
                <router-view></router-view>
            </div>
        </div>
    </div>
</template>

<script>

export default {
    name: 'index',
    data() {
        return {
        }
    },
    mounted() {

        
    },
    methods: {
        toHome() {
            this.$router.push("/teacher")
        },
    }
}
</script>

<style lang="scss" scoped>
.user {
    .custom-head {
        .top {
            width: 100%;
            height: 80px;
            background: #0D67BB;
            padding: 0 40px;
            display: flex;
            align-items: center;
            box-sizing: border-box;

            @include respond-to('phone') {
                padding: 0 20px;
            }

            .logo {
                height: 80px;

                @include respond-to('phone') {
                    height: 65px;
                }
            }

            &>.right {
                flex: 1;
                display: flex;
                justify-content: space-between;

                @include respond-to('phone') {
                    justify-content: flex-end;
                }

                .search {
                    display: flex;
                    flex: 1;

                    @include respond-to('phone') {
                        display: none;
                    }

                    .left {
                        background-color: white;
                        @include flexStyle;
                        padding: 0px 20px;
                        box-sizing: border-box;
                        margin-left: 70px;
                        height: 38px;
                        width: 65%;

                        @include respond-to('desktop') {
                            margin-left: 20px;
                        }

                        @include respond-to('pad') {
                            margin-left: 10px;
                        }

                        img {
                            width: 20px;
                            height: 20px;
                            flex-shrink: 0;
                        }

                        .el-input {
                            :deep .el-input__inner {
                                border: none;
                                border-radius: 0;
                                height: 38px;

                                &:placeholder {
                                    color: rgba($color: #333333, $alpha: 0.3);
                                }
                            }

                        }
                    }

                    .search-btn {
                        height: 38px;
                        background-color: getVar('underLine');
                        color: white;
                        border-radius: 0;
                        border: 1px solid getVar('underLine');
                        margin-left: 3px;
                    }

                    .question-btn {
                        color: white;
                        position: relative;

                        &::after {
                            content: '';
                            position: absolute;
                            left: 0;
                            right: 0;
                            bottom: 9px;
                            border-bottom: 1.3px solid white;
                        }
                    }
                }

                .icon {
                    display: flex;

                    .notic-icon {
                        width: 26px;
                    }

                    .skin-icon {
                        @include respond-to('phone') {
                            display: none;
                        }
                    }

                    &>span {
                        position: relative;
                        border: 1px solid rgba($color: #FFFFFF, $alpha: 0.2);
                        width: 38px;
                        height: 38px;
                        border-radius: 50%;
                        margin-right: 25px;
                        @include flexStyle;

                        &:nth-child(3) {
                            margin-right: 0;
                        }

                        &:nth-child(3) {
                            display: none;
                        }

                        img {
                            width: 24px;

                            @include respond-to('phone') {
                                width: 20px;
                            }
                        }

                        .dot {
                            position: absolute;
                            right: -6px;
                            top: -3px;
                            display: inline-block;
                            background-color: red;
                            color: white;
                            width: 20px;
                            height: 20px;
                            line-height: 20px;
                            text-align: center;
                            border-radius: 50%;
                        }

                        .message-popup {
                            display: none;
                            position: absolute;
                            background-color: white;
                            z-index: 21;
                            box-shadow: 2px 2px 5px rgba(0, 0, 0, .15);
                            border-radius: 5px;
                            bottom: -335px;
                            height: 320px;
                            right: -9px;
                            width: 300px;
                            padding: 5px 10px;

                            .header {
                                color: black;
                                display: flex;
                                justify-content: space-between;
                                line-height: 40px;

                                .left {
                                    span:first-child {
                                        color: #222;
                                        font-weight: 600;
                                        margin-right: 3px;
                                    }

                                    span:last-child {
                                        color: getVar('underLine');

                                    }
                                }

                                .right {
                                    color: getVar('headBg');
                                }
                            }

                            .message-list {
                                .item {
                                    display: flex;
                                    color: #333;
                                    border-bottom: 1px dashed #ebebeb;
                                    padding: 20px 2px;

                                    img {
                                        width: 40px;
                                        height: 40px;
                                        margin-right: 6px;
                                    }

                                    .middle {
                                        flex: 1;

                                        p:first-child {
                                            font-size: 14px;
                                        }

                                        p:last-child {
                                            color: #555555;
                                            font-size: 13px;
                                            overflow: hidden;
                                            white-space: nowrap;
                                            text-overflow: ellipsis;
                                        }
                                    }

                                    .time {
                                        display: flex;
                                        flex-direction: column;
                                        color: #555555;
                                        font-size: 13px;

                                        .num {
                                            width: 18px;
                                            height: 18px;
                                            background-color: getVar('noticColor');
                                            color: white;
                                            border-radius: 50%;
                                            line-height: 20px;
                                            text-align: center;
                                            align-self: flex-end;
                                            font-size: 12px;
                                            margin-top: 3px;
                                        }
                                    }
                                }
                            }

                            .bottom {
                                color: #979696;
                                text-align: center;
                                margin-top: 10px;
                            }
                        }

                        &:hover {
                            .message-popup {
                                display: block;
                            }
                        }

                        @include respond-to('phone') {
                            width: 30px;
                            height: 30px;
                            margin-right: 12px;

                            &:nth-child(2) {
                                margin-right: 8px;
                            }

                            &:nth-child(3) {
                                margin-right: 0;
                                display: flex;
                            }
                        }
                    }

                }
            }
        }
    }

    .content {
        display: flex;

        .left {
            width:200px;
            min-height: 100vh;

            .el-col-12 {
                width: 100%;
                height: 100%;

                .el-menu {
                    height: 100%;
                }
            }
        }

        .right {
            flex: 1;
            .el-breadcrumb{
                margin: 25px 0 0 20px;
            }
        }
    }
}
</style>